<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>Ajax之post请求</title>
</head>
<body>
	<h1>jquery 发送 post ajax 查询</h1>
	<form action="">
		<p><input type="text" name="u" value="" placeholder="用户名" /></p>
		<p><input type="text" name="p" value="" placeholder="密码" /></p>
		<p><input type="submit" name="" value="提交" /></p>
	</form>
</body>
<script type="text/javascript" src="./jquery-3.1.1.js"></script>
<script type="text/javascript">
	$('form').submit(function(){
		var  data = {
			'u' : $('input[name="u"]').val(),
			'p' : $('input[name="p"]').val()
		}

		$.post('23.php',data,function(res){
			alert(res);
		});
		return false;
	});
</script>
</html>